package Demo3;

import java.util.PriorityQueue;
import java.util.Scanner;

public class Main7 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int len = in.nextInt();
        int x = in.nextInt();
        int ret = 0;
        PriorityQueue<Integer> queue = new PriorityQueue<>(((o1, o2) -> o2 - o1));
        for(int i = 0; i < len; i++) {
            int n = in.nextInt();
            if(n % 2 == 0) {
                queue.add(n);
            }else {
                ret += n;
            }
        }
        while(x > 1) {
            int n = queue.poll() / 2;
            if(n % 2 == 1) {
                ret+= n;
                continue;
            }
            queue.add(n);
            x--;
        }
        while(!queue.isEmpty()) {
            ret += queue.poll();
        }

        System.out.print(ret);
    }
}